﻿@model myFinance.Models.LogOnModel
@{
    ViewBag.Title = "Entrar";
    Layout = null;
}
<link href="@Url.Content("~/Content/SitePublico.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.6.4.min.js")" type="text/javascript"></script>
<style type="text/css">
    #page
    {
        text-align: center;
        padding: 0;
        min-width: 930px !important;
        width: 980px !important;
    }
    section
    {
        margin: 40px auto;
        padding: 20px;
        min-width: 400px;
        width: 440px;
        background-color: #ffffff;
        text-align: center;
        float: left;
    }
    #side
    {
        float: right;
    }
    fieldset
    {
        margin: 20px auto;
        padding: 0;
        text-align: left;
        width: 200px;
    }
    input[type="submit"]
    {
        margin-top: 0;
        margin-left: 220px;
    }
    .editor-field
    {
        height: 50px;
    }
    p
    {
        font-size: 24px;
    }
</style>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div id="page">
    <section id="main">
        <h2>
            Entrar</h2>
        <br />
        Por favor, digite seu nome de Usuário e sua Senha...        
        @Html.ValidationSummary(true, "Não foi possível entrar! Por favor, corrija os erros e tente novamente.")
        @using (Html.BeginForm())
        {
            <div>
                <fieldset>
                    <legend></legend>
                    <div class="editor-label">
                        @Html.LabelFor(m => m.UserName)
                    </div>
                    <div class="editor-field">
                        @Html.TextBoxFor(m => m.UserName)
                        <br />
                        @Html.ValidationMessageFor(m => m.UserName)
                        <br />
                    </div>
                    <div class="editor-label">
                        @Html.LabelFor(m => m.Password)
                    </div>
                    <div class="editor-field">
                        @Html.PasswordFor(m => m.Password)
                        <br />
                        @Html.ValidationMessageFor(m => m.Password)
                        <br />
                    </div>
                    <div class="editor-label">
                        &nbsp;
                    </div>
                    <div class="editor-field">
                        @Html.CheckBoxFor(m => m.RememberMe)
                        @Html.LabelFor(m => m.RememberMe)
                    </div>
                    <input type="submit" value="Entrar" />
                </fieldset>
            </div>
        }
    </section>
    <section id="side">
        <p>
            ... ou entre com sua conta do facebook!
            <br />
            @*<a href="http://www.facebook.com/dialog/oauth?scope=email,user_birthday&client_id=234153039989125&redirect_uri=http://andreloty.no-ip.org/finance/Cadastro/FacebookLogin?token=token">
                <img src="@Url.Content("~/Content/Imagens/login_facebook.png")" alt="Entrar pelo Facebook" /></a>*@
        </p>
        <script>
            window.fbAsyncInit = function () {
                FB.init({ appId: '234153039989125',
                    status: true, cookie: false, xfbml: true, oauth: true,
                });
            };
            function afterFacebookConnect() {
               FB.getLoginStatus(function(response) {
                    if (response.authResponse) {
                        window.location = "../Cadastro/FacebookLogin?token=" +
                        response.authResponse.accessToken;
                    } else {
                        // user clicked Cancel
                    }
                });
            };
            (function (d, s, id) {
                var js, fjs = d.getElementsByTagName(s)[0];
                if (d.getElementById(id)) return;
                js = d.createElement(s); js.id = id;
                js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=234153039989125";
                fjs.parentNode.insertBefore(js, fjs);
            } (document, 'script', 'facebook-jssdk'));
        </script>
        <fb:login-button scope="email" onlogin="afterFacebookConnect();" autologoutlink="false"></fb:login-button>
        <div id="fb-root" style="display: inline; margin-left: 20px;">
        </div>
        <p style="margin-top: 70px;">
            ... ou @Html.ActionLink("clique aqui", "Registro") para se cadastrar.
        </p>
    </section>
    <footer>
		&#169; 2011 - Personal Micro Finance
		</footer>
</div>
